Skip to content

Split initialize function and add post-initialize phase - #1467

Closed
KFilipek wants to merge 4 commits into
oneapi-src:mainfrom
KFilipek:post_initialize
Closed

Split initialize function and add post-initialize phase#1467
KFilipek wants to merge 4 commits into
oneapi-src:mainfrom
KFilipek:post_initialize

Conversation

@KFilipek

Copy link
Copy Markdown
Contributor

Description

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used
  • All API changes are reflected in docs and def/map files, and are tested

@KFilipek KFilipek self-assigned this Jul 25, 2025
@KFilipek
KFilipek requested a review from a team as a code owner July 25, 2025 09:25
@bratpiorka
bratpiorka marked this pull request as draft July 28, 2025 09:22
@KFilipek
KFilipek force-pushed the post_initialize branch 17 times, most recently from 54df467 to 40c6dfc Compare August 1, 2025 08:46
@KFilipek
KFilipek marked this pull request as ready for review August 1, 2025 10:14
@KFilipek
KFilipek requested review from bratpiorka and lplewa August 1, 2025 10:15
Comment thread include/umf/memory_pool_ops.h Outdated
Comment on lines +171 to +176
/// @param provider memory provider that will be used for coarse-grain allocations.
/// Should contain at least one memory provider.
/// @param numProvider number of elements in the providers array
/// @param params pool-specific params, or NULL for defaults
/// @param pool [out] returns pointer to the pool
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write better documentation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread src/memory_provider.c Outdated
Comment thread src/pool/pool_disjoint.c
Comment thread src/pool/pool_disjoint.c
Comment thread src/memory_pool.c Outdated
Comment thread src/pool/pool_disjoint.c
Comment thread test/pools/jemalloc_pool.cpp Outdated
Comment thread include/umf/memory_pool_ops.h Outdated
Comment thread src/memory_pool.c Outdated
Comment thread src/memory_pool.c Outdated
Comment thread include/umf/memory_pool_ops.h Outdated
Comment thread .github/workflows/reusable_compatibility.yml Outdated
Comment thread src/provider/provider_cuda.c Outdated
void *provider) {
(void)params;
(void)provider;
// For initial version, just return success

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is ext function, can't we just omit it, when not needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - this would be replaced by "default" handler during provider creation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@KFilipek
KFilipek force-pushed the post_initialize branch 2 times, most recently from a5f6195 to 7aca774 Compare August 4, 2025 11:53
Comment thread .github/workflows/reusable_compatibility.yml Outdated
Comment thread include/umf/memory_pool_ops.h Outdated
Comment thread include/umf/memory_pool_ops.h Outdated
Comment thread include/umf/memory_pool_ops.h Outdated
Comment thread src/pool/pool_disjoint.c
Comment thread include/umf/memory_pool_ops.h Outdated
Comment thread src/provider/provider_cuda.c Outdated
void *provider) {
(void)params;
(void)provider;
// For initial version, just return success

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - this would be replaced by "default" handler during provider creation

Comment thread src/memory_provider.c Outdated
Comment thread include/umf/memory_pool_ops.h
Comment thread include/umf/memory_provider_ops.h
@KFilipek
KFilipek force-pushed the post_initialize branch 7 times, most recently from 172429a to 1fcad79 Compare August 5, 2025 17:19
/// \details
/// * This function *must* be implemented if the pool/provider supports CTL that overrides defaults.
/// * This function *must* free any resources allocated in the function.
/// * This function *must* be called after the memory pool has been allocated in initialize function

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function *must* be called after the memory pool has been allocated in initialize function

Must be called by whom? If UMF calls it, then the comment is missleading.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about the function order. Generally, this function is the same case as initialize(), it's also invoked in the same way - internally.

Comment thread include/umf/memory_pool_ops.h
@KFilipek
KFilipek force-pushed the post_initialize branch 10 times, most recently from eaab2b7 to a3ac32a Compare August 7, 2025 14:32
Split between initialize and post-initialize function is necessary
for properly handling CTL defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants